<?php


class m_job extends M {



	function __init__ () {
	
		//$this->db->settable("www_t");
	
	}
	
	function job_tree() {
		
		$this->db->settable("www_tree")->init();
		$list = $this->php->db->select();
		
		
		//行业列表
		$hy_list = list_to_tree($list,"id","pid","_child",2,0);
		$this->view->assign("hy_list",$hy_list);
		
		//地区列表
		$dq_list = list_to_tree($list,"id","pid","_child",6,0);
		$this->view->assign("dq_list",$dq_list);
		
		//工作经验
		$jy_list = list_to_tree($list,"id","pid","_child",7,0);
		$this->view->assign("jy_list",$jy_list);
		
		//薪资要求
		$xz_list = list_to_tree($list,"id","pid","_child",8,0);
		$this->view->assign("xz_list",$xz_list);
		
		//学历要求
		$xl_list = list_to_tree($list,"id","pid","_child",26,0);
		$this->view->assign("xl_list",$xl_list);
		
	
	}
	
	function job_soget() {
	
		// -----------------------------
		
		$hangye = !empty($_GET["hangye"]) ? (int)$_GET["hangye"] : 0 ;
		$diqu = !empty($_GET["diqu"]) ? (int)$_GET["diqu"] : 0 ;
		$jingyan = !empty($_GET["jingyan"]) ? (int)$_GET["jingyan"] : 0 ;
		$xueli = !empty($_GET["xueli"]) ? (int)$_GET["xueli"] : 0 ;
		$xinzi = !empty($_GET["xinzi"]) ? (int)$_GET["xinzi"] : 0 ;
		$etime = !empty($_GET["etime"]) ? (int)$_GET["etime"] : 0 ;
		
		
		if(!empty($hangye)) $where["hangye"] = $hangye;
		if(!empty($diqu)) $where["diqu"] = $diqu;
		if(!empty($jingyan)) $where["jingyan"] = $jingyan;
		if(!empty($xueli)) $where["xueli"] = $xueli;
		if(!empty($etime)) {
		
			$ntime =time();
			$vtime = $ntime - (int)$_GET["etime"];
			$where["etime >"] = $vtime;
		
		}
		
		if(empty($where)) $where="";
		
		// -----------------------------
		
		return $where;
	
	}
	
	function job_so_geturl() {
	
		$hangye = !empty($_GET["hangye"]) ? (int)$_GET["hangye"] : 0 ;
		$diqu = !empty($_GET["diqu"]) ? (int)$_GET["diqu"] : 0 ;
		$jingyan = !empty($_GET["jingyan"]) ? (int)$_GET["jingyan"] : 0 ;
		$xueli = !empty($_GET["xueli"]) ? (int)$_GET["xueli"] : 0 ;
		$xinzi = !empty($_GET["xinzi"]) ? (int)$_GET["xinzi"] : 0 ;
		$etime = !empty($_GET["etime"]) ? (int)$_GET["etime"] : 0 ;
		
		$url ="";
		
		
		if(!empty($hangye)) $url.="&hangye=".$hangye;
		if(!empty($diqu)) $url.="&diqu=".$diqu;
		if(!empty($jingyan)) $url.="&jingyan=".$jingyan;
		if(!empty($xueli)) $url.="&xueli=".$xueli;
		if(!empty($etime)) $url.="&etime=".$etime;
		
		return $url;
	
	}












}